import React, {Component} from "react";
import Row from "./Row";

export default class Checkerboard extends Component {
    playChess(row, col) {
        this.props.playChess(row,col)
    }

    render() {
        const {checkerboardData} = this.props

        return (
            <div className="checkerboard">
                <div>
                    {
                        checkerboardData.map((item, index) => <Row key={index} rowData={item} row={index}
                                                                   playChess={this.playChess.bind(this)}/>)
                    }
                </div>
            </div>
        );
    }
}